package cn.lijiajia3515.cairo.auth.domain.mongo;

import cn.lijiajia3515.cairo.mongo.data.AbstractMongo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import lombok.experimental.SuperBuilder;
import org.bson.types.ObjectId;
import org.springframework.data.mongodb.core.mapping.MongoId;

import java.util.List;


/**
 * 部门
 */
@EqualsAndHashCode(callSuper = true)
@Data
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
@SuperBuilder(toBuilder = true)
public class DepartmentMongo extends AbstractMongo {

	/**
	 * 标识
	 */
	@MongoId
	private ObjectId _id;

	/**
	 * client
	 */
	private String client;

	/**
	 * 唯一标识
	 */
	private String id;

	/**
	 * 父级
	 */
	private String parent;

	/**
	 * 祖先
	 */
	private List<String> ancestors;

	/**
	 * 名称
	 */
	private String name;

	/**
	 * 备注
	 */
	private String remark;


	public static final Field FIELD = new Field();

	public static final class Field extends AbstractMongo.Field {
		private Field() {
		}

		public final String ID = field("Id");
		public final String CLIENT = field("Client");
		public final String PARENT = field("Parent");
		public final String ANCESTORS = field("Ancestors");
		public final String NAME = field("Name");
		public final String REMARK = field("Remark");
	}
}
